package com.siyuanren.gcocp.dto.wx;

/**
 * @author guwr
 * @date 2018/5/11
 */

import cn.hutool.core.date.DateUtil;
import com.siyuanren.gcocp.common.util.EnumUtil;
import com.siyuanren.gcocp.entity.WxUserVoucher;
import com.siyuanren.gcocp.enums.wx.VoucherStateEnum;
import lombok.Getter;
import lombok.Setter;


/**
 */
@Getter
@Setter
public class WxUserVoucherDTO extends WxUserVoucher {
    private String userName;
    private String headImgurl;
    //  如果是首次领取，需要弹出对话框
    private Boolean isFirst;

    public String getVoucherStatusStr() {
        return EnumUtil.getEnumDesc(getVoucherState(), VoucherStateEnum.class);
    }

    public String getVoucherOverdueDateStr() {
        return DateUtil.formatDate(getVoucherOverdueDate());
    }

    public Long getBetweenDay() {
        return DateUtil.betweenDay(DateUtil.date(), getVoucherOverdueDate(), true);
    }
}
